Re: [GENERAL] int2/int4 Failure with 6.5.1 and SlackWare 4.0

Поиск
Список
Период
Сортировка
От Herouth Maoz
Тема Re: [GENERAL] int2/int4 Failure with 6.5.1 and SlackWare 4.0
Дата
Msg-id l03130302b3c4e0ddfd2b@[147.233.159.109]
обсуждение исходный текст
Ответ на int2/int4 Failure with 6.5.1 and SlackWare 4.0  (Charles Tassell <ctassell@isn.net>)
Список pgsql-general
At 19:16 +0300 on 28/07/1999, Charles Tassell wrote:


> Here is the error from int2.out:
>
> QUERY: CREATE TABLE INT2_TBL(f1 int2);
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('0');
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('1234');
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-1234');
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('34.5');
> ERROR:  pg_atoi: error in "34.5": can't parse ".5"
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('32767');
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-32767');
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('100000');
> ERROR:  pg_atoi: error reading "100000": Math result not representable
> QUERY: INSERT INTO INT2_TBL(f1) VALUES ('asdf');
> ERROR:  pg_atoi: error in "asdf": can't parse "asdf"
> QUERY: SELECT '' AS five, INT2_TBL.*;
>
>
> Any ideas what is causing this?  It seems to be a problem with the pg_atoi
> function giving a fatal error on any data that is not formatted exactly
> right, or too large for it's return type.

You are looking in the wrong direction. Some of the regression tests
actually produce errors, and the regression test runs the same test, and is
supposed to produce the same errors.

In this test, 34.5 is not a valid integer. 100000 is an integer, but
outside the 2-byte range (which goes -32768 to 32767). And 'asdf' is simply
not a number. So, all these error messages are good and right.

In a regression test, always look at the *diff* files. They tell you what
the differences were between the original and your test, whether the
original result was a normal one or a deliberate error.

My guess is that in your case, you will simply find that the difference
results from some different error message. Perhaps your system would say
"out of range" instead of "Math result not representable". Check the diff.
If this is true, then you have nothing to worry about.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



В списке pgsql-general по дате отправления:

Предыдущее
От: Charles Tassell
Дата:
Сообщение: int2/int4 Failure with 6.5.1 and SlackWare 4.0
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Access problems on temp tables